/**
 * @file BatteryData.h
 * @author  
 * @brief 电池数据类型
 * @version 1.0
 * @date 2021-04-01
 * 
 * @copyright Copyright (c) 2021
 * 
 */

#pragma once
#include <cstdint>
#include "lib/Time.h"

namespace behavior_controller
{

    class BatteryData
    {
    public:
        BatteryData(){};
        BatteryData(float _voltage, float _temperature, float _current,float _charge,
                    float _percentage, float _capacity, bool _present) 
                : voltage(_voltage),temperature(_temperature),current(_current),
                  charge(_charge),percentage(_percentage),capacity(_capacity),present(_present){};

        float GetVoltage(){return voltage;};
        float GetTemperature(){return temperature;};
        float GetCurrent(){return current;};
        float GetCharge(){return charge;};
        float GetPercentage(){return percentage;};
        float GetCapacity(){return capacity;};
        bool  GetPresent(){return present;};
        void  SetTime() {real_time= Time::Now();};
        void  SetTime(double _time) {real_time= _time;};
        double GetRealTime(){return real_time;};
        
    private:
        double real_time=0;
        float voltage;          //电压
        float temperature;      //温度
        float current;          //放电电流
        float charge;           //充电电流
        float percentage;       //剩余电量百分比 Charge percentage on 0 to 1 range  (If unmeasured NaN)
        float capacity;         //Capacity in Ah (last full capacity)  (If unmeasured NaN)
        bool present;    //电池是否存在
    };

} // namespace behavior_controller
